package com.hao.cdk.common.pojo;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * @author: 许自豪
 * @date: 2025-01-23 14:34:52
 * @description:
 */
@Data
public class BasePage {

    @ApiModelProperty(value = "页长")
    private long pageSize = 10;

    @ApiModelProperty(value = "页码")
    private long pageNum = 1;

    @ApiModelProperty(value = "开始分页位置", hidden = true)
    private long startLimit = 0;

    public BasePage() {

    }

    public BasePage(long pageSize, long pageNum) {
        if (pageNum > 1) {
            this.startLimit = (pageNum - 1) * pageSize;
        }
        this.pageSize = pageSize;
        this.pageNum = pageNum;

    }

    public long getPageSize() {
        return pageSize;
    }

    public void setPageSize(long pageSize) {
        this.pageSize = pageSize;
    }

    public long getPageNum() {
        return pageNum;
    }

    public void setPageNum(long pageNum) {
        this.pageNum = pageNum;
    }

    public long getStartLimit() {
        return startLimit;
    }

    public void setStartLimit(long startLimit) {
        this.startLimit = startLimit;
    }
}
